package com.kirk.cts.ui.view.dialog;

import com.kirk.cts.core.event.CrawlerToolEvent;
import com.kirk.cts.core.event.CrawlerToolListener;

import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

/**
 *  <p> CrawlAboutDialog.java </p>
 *
 * @Author      kirkliu
 * @Date        2020-09-01 23:07
 * @version     1.0.0
 * @Description 关于窗口
 */
public class CrawlAboutDialog extends JDialog implements CrawlerToolListener {
    private static final long serialVersionUID = 1L;

    public CrawlAboutDialog(JFrame owner) {
        super(owner, "淡泊以明志,宁静以致远", true);
        setBounds(new Rectangle(
                (int) owner.getX() + 200,
                (int) owner.getY() + 300,
                300,
                150
        ));
        add(new JLabel("<html>如石子一粒,仰高山之巍峨,但不自惭形秽.<br /><br />若小草一棵,慕白杨之伟岸,却不妄自菲薄.</html>"), BorderLayout.CENTER);
        JButton ok = new JButton("确定");
        ok.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                setVisible(false);
            }
        });
        JPanel panel = new JPanel();
        panel.add(ok);
        add(panel, BorderLayout.SOUTH);
    }

    @Override
    public void update(CrawlerToolEvent event) {
        // TODO Auto-generated method stub

    }


}
